<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>


<title>店铺列表 - 云超市</title>

<link rel="stylesheet" href="${contextPath}/static/ace/components/_mod/jquery-ui/jquery-ui.css" />
<link rel="stylesheet" href="${contextPath}/static/ace/components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css" />
<link rel="stylesheet" href="${contextPath}/static/ace/components/_mod/jqgrid/ui.jqgrid.css" />
<%--<jsp:include page="../../head.jsp"/>--%>
<style type="text/css">
	.customBtn {
		line-height: 20px;
	    margin-bottom: 3px;
	}
	.btnLine {
		margin-left: 1px; 
		margin-top: 8px;
		margin-bottom: 2px;
	}

	.autocomplete-suggestions {
		border: 1px solid #999;
		background: #FFF;
		overflow: auto;
	}

	.autocomplete-suggestion {
		padding: 2px 5px;
		white-space: nowrap;
		overflow: hidden;
	}

	.autocomplete-selected {
		background: #F0F0F0;
	}

	.autocomplete-suggestions strong {
		font-weight: normal;
		color: #3399FF;
	}

	@-moz-document url-prefix() {
		fieldset {
			display: table-cell;
		}
	}
</style>

<div class="row">
	<div class="row btnLine" >
		<div class="button-len col-sm-12">

					<%--<select id="stateInput" class="hide">
						<option value="-1">==审核状态==</option>
						<option value="3">待审核</option>
						<option value="1">通过</option>
						<option value="4">拒绝</option>
						<option value="0">无效</option>
					</select>--%>

					<form class="form-inline">
						<shiro:hasPermission name="CLOUDERPSHOP:AUDIT">
							<button type="button" class="btn btn-white btn-info btn-sm customBtn" id="editShop">
								<i class="ace-icon fa fa-pencil blue"></i> 修改
							</button>
						</shiro:hasPermission>

						<shiro:hasPermission name="CLOUDERPORDERSPLADMINORDER:STATISTICS">
							<div class="form-group">
								<input class="form-control input-sm" onfocus="this.value=''" type="text" id="quXianNameInput"
									   placeholder="区县名称">
							</div>
						</shiro:hasPermission>
						<shiro:lacksPermission name="CLOUDERPORDERSPLEMPORDER:STATISTICS">
							<shiro:lacksPermission name="CLOUDERPORDERSPLCHANNELORDER:STATISTICS">
								<div class="form-group">
									<input class="form-control input-sm"  onfocus="this.value=''"type="text" id="quDaoNameInput"
										   placeholder="渠道名称">
								</div>
							</shiro:lacksPermission>
							<div class="form-group">
								<input class="form-control input-sm" onfocus="this.value=''" type="text" id="slsmanNameInput"
									   placeholder="客户经理名称">
							</div>
						</shiro:lacksPermission>
						<div class="form-group">
							<input class="form-control input-sm" type="text" id="custNameInput"
								   placeholder="客户名称">
						</div>
						<div class="form-group">
							<input class="form-control input-sm" type="text" id="custCodeInput" placeholder="专卖证号">
						</div>
						<div class="form-group">
							<input class="form-control input-sm" type="text" id="shopNameInput" style=""
								   placeholder="店铺名称">
						</div>
						<div class="form-group">
							<input class="form-control input-sm" type="text" id="phoneInput" placeholder="店主手机号码">
						</div>
						<div class="form-group">
							<select class="form-control input-sm" id="isExpInput">
								<option value="-1">==是否试点==</option>
								<option value="1">是</option>
								<option value="0">否</option>
							</select>
						</div>
						<div class="form-group">
							<select class="form-control input-sm" id="isAuthInput">
								<option value="-1">==是否授权==</option>
								<option value="1">是</option>
								<option value="0">否</option>
							</select>
						</div>
						<div class="form-group">
							<input class="form-control input-sm" type="text" id="firstTimeInput"
								   placeholder="扫码开始时间">
						</div>
						<div class="form-group">
							<input class="form-control input-sm" type="text" id="endTimeInput"
								   placeholder="扫码结束时间">
						</div>
						<button type="button" class="btn btn-sm btn-white btn-info search-len customBtn"
								onclick="searchShop()">
							<i class="ace-icon fa fa-search orange"></i>搜索
						</button>
						<button type="button" class="btn btn-sm btn-white btn-success search-len customBtn"
								onclick="exportExcel()">
							<i class="ace-icon fa fa-file-excel-o green"></i>导出
						</button>
					</form>
			</div>
	</div>
	
	<div class="col-xs-12">

		<table id="grid-table"></table>

		<div id="grid-pager"></div>

	</div>
</div>

<!-- 导出Excel -->
<form action="${contextPath}/sys/clouderp/clouderpExportExcel" method="post" id="exportExcel" style="display:none">
	<input type="hidden" id="exportExcelData-quXianName" name="stringMap['quXianName']">
	<input type="hidden" id="exportExcelData-channelName" name="stringMap['channelName']">
	<input type="hidden" id="exportExcelData-empName" name="stringMap['empName']">
	<input type="hidden" id="exportExcelData-custName" name="stringMap['custName']">
	<input type="hidden" id="exportExcelData-custCode" name="stringMap['custCode']">

	<input type="hidden" id="exportExcelData-shopName" name="stringMap['shopName']">
	<input type="hidden" id="exportExcelData-phone" name="stringMap['phone']">
	<input type="hidden" id="exportExcelData-isExp" name="stringMap['isExp']">
	<input type="hidden" id="exportExcelData-isAuth" name="stringMap['isAuth']">

	<input type="hidden" id="exportExcelData-firstTime" name="stringMap['firstTime']">
	<input type="hidden" id="exportExcelData-endTime" name="stringMap['endTime']">
	<input type="hidden" name="tableType" value="shop">
</form>


<!-- page specific plugin scripts -->

<script type="text/javascript" src="${contextPath}/static/ace/components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="${contextPath}/static/ace/components/jqGrid/js/jquery.jqGrid.js"></script>
<script type="text/javascript" src="${contextPath}/static/ace/components/jqGrid/js/i18n/grid.locale-cn.js"></script>
<script type="text/javascript">
	var scripts = [null,"${contextPath}/static/ace/components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js","${contextPath}/static/ace/components/jqGrid/js/jquery.jqGrid.js","${contextPath}/static/ace/components/jqGrid/js/i18n/grid.locale-cn.js", null]
	$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
	
	jQuery(function($) {
		var grid_selector = "#grid-table";
		var pager_selector = "#grid-pager";
		
		
		var parent_column = $(grid_selector).closest('[class*="col-"]');
		//resize to fit page size
		$(window).on('resize.jqGrid', function () {
			$(grid_selector).jqGrid( 'setGridWidth', parent_column.width() );
	    })
		
		//resize on sidebar collapse/expand
		$(document).on('settings.ace.jqGrid' , function(ev, event_name, collapsed) {
			if( event_name === 'sidebar_collapsed' || event_name === 'main_container_fixed' ) {
				//setTimeout is for webkit only to give time for DOM changes and then redraw!!!
				setTimeout(function() {
					$(grid_selector).jqGrid( 'setGridWidth', parent_column.width() );
				}, 20);
			}
	    })
		
		jQuery(grid_selector).jqGrid({
			//direction: "rtl",
	
			//subgrid options
			subGrid : false,
			url: "${contextPath}/sys/clouderp/getShopInfo",
			//data: grid_data,
			datatype: "json",
			mtype : 'POST',
			height: 300,
			colNames:['ID','店铺名称','地址', '状态', '创建人ID','店主','电话号码', '是否试点',  '创建时间' , '扫码次数','扫码天数'],
			colModel:[
				{name:'id',index:'id', width:60, editable: true,hidden:true},
				{name:'shopName',index:'shopName',width:90, editable:false, sortable:false},
				{name:'address',index:'address', width:150,editable: false, sortable:false},
				{name:'stateStr',index:'stateStr', hidden:true, width:70, editable: false,edittype:"select", sortable:false,editoptions: {value:"1:通过;4:拒绝;0:无效"}},//"0:无效;1:通过;3:待;4:拒绝"
				{name:'userId',index:'userId', width:90, editable: true, hidden:true,sortable:false},
				{name:'username',index:'username', width:90, editable: false, sortable:false},
                {name:'phone',index:'phone', width:90, editable: false, sortable:false},
                {name:'isExp',index:'isExp', width:90, editable: true, sortable:false ,edittype:"select",editoptions: {value:"1:是;0:否"}},
				{name:'createTime',index:'createTime', width:150, editable: false, hidden:true},
				{name:'shipmentCount',index:'shipmentCount', width:100, editable: false},
				{name:'shipmentDayCount',index:'shipmentDayCount', width:100, editable: false}

			], 
			sortname : "createTime",
			sortorder : "desc",
			viewrecords : true,
			rowNum:10,
			rowList:[10,20,30],
			pager : pager_selector,
			altRows: true,
			//toppager: true,
			
			multiselect: false,
			//multikey: "ctrlKey",
	        multiboxonly: false,

            loadComplete : function() {
				var table = this;
				setTimeout(function(){
					styleCheckbox(table);
					
					updateActionIcons(table);
					updatePagerIcons(table);
					enableTooltips(table);
				}, 0);
			},
	
			editurl: "${contextPath}/sys/clouderp/editShopInfo",//nothing is saved
			caption: "店铺信息",
			jsonReader : {  
				root:"recordList",  
				page: "currentPage",  
				total: "pageCount",  
				records: "recordCount"
			}
	
			//,autowidth: true,
	
	
			/**
			,
			grouping:true, 
			groupingView : { 
				 groupField : ['name'],
				 groupDataSorted : true,
				 plusicon : 'fa fa-chevron-down bigger-110',
				 minusicon : 'fa fa-chevron-up bigger-110'
			},
			caption: "Grouping"
			*/
	
		});
		$(window).triggerHandler('resize.jqGrid');//trigger window resize to make the grid get the correct size
		
		$("#editShop").click(function() {
			var id = $(grid_selector).jqGrid('getGridParam', 'selrow');
			if (!id) {
				$.jgrid.info_dialog( "提示：", "请选择一条信息");
				return;
			}
            var rowData = $(grid_selector).jqGrid('getRowData',id);
			//console.log(rowData)
			$(grid_selector).jqGrid("editGridRow",id,{
										// edit record form
										width : 500,
										closeAfterEdit : true,
										//editData : 
										recreateForm : true,
										viewPagerButtons : false,
										beforeShowForm : function(e) {
											var form = $(e[0]);
											form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar')
													.wrapInner('<div class="widget-header" />');
											style_edit_form(form);
										},
                						beforeSubmit : function(postdata, formid) {
                                            var isExp = rowData.isExp;
                                            switch (postdata.isExp) {
												case '1' :
												    if (isExp == '是') {
                                                        return [false,"该店铺已经是试点用户"];
													}
												    break;
												case '0' :
                                                    if (isExp == '否') {
                                                        return [false,"该店铺已经不是试点用户"];
                                                    }
												    break;
												default  :
												    break;
											}
											return [true,""]
										    //console.log(postdata)
										   // console.log(formid)

										},
										afterSubmit : function(response, postdata) {
											var result = eval('('+ response.responseText + ')');
											//console.log(result);
											return [result.success,result.message,0] ;
											},
										errorTextFormat : function(response) {
											//console.log("错误"+response.responseText);
											//var result = response.responseText;
											return "服务器异常，稍后再试";
										}
									});
				});
	
		//enable search/filter toolbar
		//jQuery(grid_selector).jqGrid('filterToolbar',{defaultSearch:true,stringResult:true})
		//jQuery(grid_selector).filterToolbar({});
	
	
		//switch element when editing inline
		function aceSwitch( cellvalue, options, cell ) {
			setTimeout(function(){
				$(cell) .find('input[type=checkbox]')
					.addClass('ace ace-switch ace-switch-5')
					.after('<span class="lbl"></span>');
			}, 0);
		}
		//enable datepicker
		function pickDate( cellvalue, options, cell ) {
			setTimeout(function(){
				$(cell) .find('input[type=text]')
					.datepicker({format:'yyyy-mm-dd' , autoclose:true}); 
			}, 0);
		}
	
	
		//navButtons
		jQuery(grid_selector).jqGrid('navGrid',pager_selector,
			{ 	//navbar options
				edit: false,
				editicon : 'ace-icon fa fa-pencil blue',
				add: false,
				addicon : 'ace-icon fa fa-plus-circle purple',
				del: false,
				delicon : 'ace-icon fa fa-trash-o red',
				search: false,
				searchicon : 'ace-icon fa fa-search orange',
				refresh: true,
				refreshicon : 'ace-icon fa fa-refresh green',
				view: false,
				viewicon : 'ace-icon fa fa-search-plus grey',
			},
			{
				//edit record form
				//closeAfterEdit: true,
				//width: 700,
				recreateForm: true,
				beforeShowForm : function(e) {
					var form = $(e[0]);
					form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
					style_edit_form(form);
				}
			},
			{
				//new record form
				//width: 700,
				closeAfterAdd: true,
				recreateForm: true,
				viewPagerButtons: false,
				beforeShowForm : function(e) {
					var form = $(e[0]);
					form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar')
					.wrapInner('<div class="widget-header" />')
					style_edit_form(form);
				}
			},
			{
				//delete record form
				recreateForm: true,
				beforeShowForm : function(e) {
					var form = $(e[0]);
					if(form.data('styled')) return false;
					
					form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
					style_delete_form(form);
					
					form.data('styled', true);
				},
				onClick : function(e) {
					//alert(1);
				}
			},
			{
				//search form
				recreateForm: true,
				afterShowSearch: function(e){
					var form = $(e[0]);
					form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />')
					style_search_form(form);
				},
				afterRedraw: function(){
					style_search_filters($(this));
				}
				,
				multipleSearch: true,
				/**
				multipleGroup:true,
				showQuery: true
				*/
			},
			{
				//view record form
				recreateForm: true,
				beforeShowForm: function(e){
					var form = $(e[0]);
					form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />')
				}
			}
		)
	
	
		
		function style_edit_form(form) {
			//enable datepicker on "sdate" field and switches for "stock" field
			//form.find('input[name=sdate]').datepicker({format:'yyyy-mm-dd' , autoclose:true})
			
			//form.find('input[name=stock]').addClass('ace ace-switch ace-switch-5').after('<span class="lbl"></span>');
					   //don't wrap inside a label element, the checkbox value won't be submitted (POST'ed)
					  //.addClass('ace ace-switch ace-switch-5').wrap('<label class="inline" />').after('<span class="lbl"></span>');
	
					
			//update buttons classes
			var buttons = form.next().find('.EditButton .fm-button');
			buttons.addClass('btn btn-sm').find('[class*="-icon"]').hide();//ui-icon, s-icon
			buttons.eq(0).addClass('btn-primary').prepend('<i class="ace-icon fa fa-check"></i>');
			buttons.eq(1).prepend('<i class="ace-icon fa fa-times"></i>')
			
			buttons = form.next().find('.navButton a');
			buttons.find('.ui-icon').hide();
			buttons.eq(0).append('<i class="ace-icon fa fa-chevron-left"></i>');
			buttons.eq(1).append('<i class="ace-icon fa fa-chevron-right"></i>');		
		}
	
		function style_delete_form(form) {
			var buttons = form.next().find('.EditButton .fm-button');
			buttons.addClass('btn btn-sm btn-white btn-round').find('[class*="-icon"]').hide();//ui-icon, s-icon
			buttons.eq(0).addClass('btn-danger').prepend('<i class="ace-icon fa fa-trash-o"></i>');
			buttons.eq(1).addClass('btn-default').prepend('<i class="ace-icon fa fa-times"></i>')
		}
		
		function style_search_filters(form) {
			form.find('.delete-rule').val('X');
			form.find('.add-rule').addClass('btn btn-xs btn-primary');
			form.find('.add-group').addClass('btn btn-xs btn-success');
			form.find('.delete-group').addClass('btn btn-xs btn-danger');
		}
		function style_search_form(form) {
			var dialog = form.closest('.ui-jqdialog');
			var buttons = dialog.find('.EditTable')
			buttons.find('.EditButton a[id*="_reset"]').addClass('btn btn-sm btn-info').find('.ui-icon').attr('class', 'ace-icon fa fa-retweet');
			buttons.find('.EditButton a[id*="_query"]').addClass('btn btn-sm btn-inverse').find('.ui-icon').attr('class', 'ace-icon fa fa-comment-o');
			buttons.find('.EditButton a[id*="_search"]').addClass('btn btn-sm btn-purple').find('.ui-icon').attr('class', 'ace-icon fa fa-search');
		}
		
		function beforeDeleteCallback(e) {
			var form = $(e[0]);
			if(form.data('styled')) return false;
			
			form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
			style_delete_form(form);
			form.data('styled', true);
		}
		
		function beforeEditCallback(e) {
			var form = $(e[0]);
			form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
			style_edit_form(form);
		}
	
	
	
		//it causes some flicker when reloading or navigating grid
		//it may be possible to have some custom formatter to do this as the grid is being created to prevent this
		//or go back to default browser checkbox styles for the grid
		function styleCheckbox(table) {
		/**
			$(table).find('input:checkbox').addClass('ace')
			.wrap('<label />')
			.after('<span class="lbl align-top" />')
	
	
			$('.ui-jqgrid-labels th[id*="_cb"]:first-child')
			.find('input.cbox[type=checkbox]').addClass('ace')
			.wrap('<label />').after('<span class="lbl align-top" />');
		*/
		}
		
	
		//unlike navButtons icons, action icons in rows seem to be hard-coded
		//you can change them like this in here if you want
		function updateActionIcons(table) {
			/**
			var replacement = 
			{
				'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',
				'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',
				'ui-icon-disk' : 'ace-icon fa fa-check green',
				'ui-icon-cancel' : 'ace-icon fa fa-times red'
			};
			$(table).find('.ui-pg-div span.ui-icon').each(function(){
				var icon = $(this);
				var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
				if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
			})
			*/
		}
		
		//replace icons with FontAwesome icons like above
		function updatePagerIcons(table) {
			var replacement = 
			{
				'ui-icon-seek-first' : 'ace-icon fa fa-angle-double-left bigger-140',
				'ui-icon-seek-prev' : 'ace-icon fa fa-angle-left bigger-140',
				'ui-icon-seek-next' : 'ace-icon fa fa-angle-right bigger-140',
				'ui-icon-seek-end' : 'ace-icon fa fa-angle-double-right bigger-140'
			};
			$('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){
				var icon = $(this);
				var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
				
				if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
			})
		}
	
		function enableTooltips(table) {
			$('.navtable .ui-pg-button').tooltip({container:'body'});
			$(table).find('.ui-pg-div').tooltip({container:'body'});
		}
	
		//var selr = jQuery(grid_selector).jqGrid('getGridParam','selrow');
	
		$(document).one('ajaxloadstart.page', function(e) {
			$.jgrid.gridDestroy(grid_selector);
			$('.ui-jqdialog').remove();
		});
	});
	});
</script>
<%--<script src="${contextPath}/static/system/js/common/vue.js"></script>--%>
<%--<script src="${contextPath}/static/layer/layer.js"></script>--%>
<script type="text/javascript" src="${contextPath}/static/statistics/js/jquery.mockjax.js"></script>
<script type="text/javascript" src="${contextPath}/static/statistics/js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="${contextPath}/static/util/my-autocomplete.js"></script>
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.min.js"></script>
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.fr.js"></script>
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript">
		/**
		 * 搜索店铺
		 */
		function searchShop() {

            var quXianName = $("#quXianNameInput").val();
            var quDaoName = $("#quDaoNameInput").val();
            var slsmanName = $("#slsmanNameInput").val();
            var custName = $("#custNameInput").val();
            var custCode = $("#custCodeInput").val();

            var shopName = $("#shopNameInput").val();
            var phone = $("#phoneInput").val();
            var isExp = $("#isExpInput").val();
            var isAuth = $("#isAuthInput").val();

            var firstTime = $("#firstTimeInput").val();
            var endTime = $("#endTimeInput").val();

			var filters = {
				"rules" : [ {
					"field" : "quXianName",
					"data" : quXianName ? quXianName : ""
				},{
					"field" : "channelName",
					"data" : quDaoName ? quDaoName : ""
				},{
					"field" : "empName",
					"data" : slsmanName ? slsmanName : ""
				},{
                    "field" : "custName",
                    "data" : custName
                },{
                    "field" : "custCode",
                    "data" : custCode
                },{
					"field" : "shopName",
					"data" : shopName
				},{
					"field" : "phone",
					"data" : phone
				},{
					"field" : "isExp",
					"data" : isExp
				},{
					"field" : "isAuth",
					"data" : isAuth
				},{
					"field" : "firstTime",
					"data" : firstTime
				},{
					"field" : "endTime",
					"data" : endTime
				}]
			};
			jQuery("#grid-table").jqGrid('setGridParam', {
				postData : {
					"filters" : JSON.stringify(filters) //"{'rules' : [{'field' : 'shopName','data' : "+shopName+"},{'field' : 'state','data' : "+state+"}]}"  
				}
			}).trigger("reloadGrid");
		}

        var cityNode, quXianNode, channelNode, empNode, custNode, shopNode = null;

        <shiro:lacksPermission name="CLOUDERPORDERSPLEMPORDER:STATISTICS">
        empNode = '#slsmanNameInput';
        channelNode = '#quDaoNameInput';
        <shiro:hasPermission name="CLOUDERPORDERSPLADMINORDER:STATISTICS">
        //cityNode = '#cityNameInput';
        quXianNode = '#quXianNameInput';
        </shiro:hasPermission>
        </shiro:lacksPermission>
        custNode = "#custNameInput"
        shopNode = "#shopNameInput"

        organization_tree('${contextPath}',cityNode, quXianNode, channelNode, empNode, custNode, shopNode);

        $('#firstTimeInput').datetimepicker({
            language: 'zh-CN',
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            minView: 2,
            showMeridian: 1,
            format: "yyyy-mm-dd",
            //startDate:new Date(),
        });

        $('#endTimeInput').datetimepicker({
            language: 'zh-CN',
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            minView: 2,
            showMeridian: 1,
            format: "yyyy-mm-dd",
            //startDate:new Date(),
        });

        /**
         * 导出Excel
         */
        var exportExcel = function () {

            var quXianName = $("#quXianNameInput").val();
            var quDaoName = $("#quDaoNameInput").val();
            var slsmanName = $("#slsmanNameInput").val();
            var custName = $("#custNameInput").val();
            var custCode = $("#custCodeInput").val();

            var shopName = $("#shopNameInput").val();
            var phone = $("#phoneInput").val();
            var isExp = $("#isExpInput").val();
            var isAuth = $("#isAuthInput").val();

            var firstTime = $("#firstTimeInput").val();
            var endTime = $("#endTimeInput").val();



            $('#exportExcelData-quXianName').val(quXianName);
            $('#exportExcelData-channelName').val(quDaoName);
            $('#exportExcelData-empName').val(slsmanName);
            $('#exportExcelData-custName').val(custName);
            $('#exportExcelData-custCode').val(custCode);

            $('#exportExcelData-shopName').val(shopName);
            $('#exportExcelData-phone').val(phone);
            $('#exportExcelData-isExp').val(isExp);
            $('#exportExcelData-isAuth').val(isAuth);

            $('#exportExcelData-firstTime').val(firstTime);
            $('#exportExcelData-endTime').val(endTime);
           // layer.msg('已提交导出请求，请等待结果');

            $("#exportExcel").submit();

        }
</script>
